package com.guoxin.chapter3.waitnotify.pipereaderwriter;

import java.io.IOException;
import java.io.PipedReader;
import java.io.PipedWriter;

public class Run {
	public static void main(String[] args) throws IOException, InterruptedException {
		WriteData writeData = new WriteData();
		ReadData readData = new ReadData();
		
		PipedReader reader = new PipedReader();
		PipedWriter writer = new PipedWriter();
		
		reader.connect(writer);
//		writer.connect(reader);
		
		ThreadRead read = new ThreadRead(readData, reader);
		read.start();
		Thread.sleep(1000);
		
		ThreadWrite write = new ThreadWrite(writeData, writer);
		write.start();
	}
}
